home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 80
/
080.d81
/
emp exp
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
381 lines
1 fori=49152to49270:readj:pokei,j:next
2 data 032,204,255,169,002,162,112
3 data 160,192,032,189,255,169,001
4 data 162,008,160,000,032,186,255
5 data 032,192,255,162,001,032,198
6 data 255,032,207,255,032,207,255
7 data 032,207,255,032,207,255,165
8 data 144,201,000,208,043,032,099
9 data 192,032,207,255,141,115,192
10 data 032,207,255,141,114,192,173
11 data 114,192,174,115,192,032,205
12 data 189,032,207,255,208,008,169
13 data 013,032,210,255,076,035,192
14 data 032,210,255,076,071,192,169
15 data 001,032,195,255,032,204,255
16 data 096,160,000,169,032,032,210
17 data 255,200,192,006,208,248,096
18 data 036,048,000,000,153,153,151
19 nc=11:nf=5
20 poke53281,0:poke53280,11:printchr$(8);chr$(14)
40 n=0:dima$(200,25),fd$(nf),c$(25),m$(10),df$(7),tp$(25)
42 fori=1to10:readm$(i):next
43 data "[204]oad [198]ile ","[211]ave [198]ile ","[193]dd [210]ecord ","[195]hange [210]ecord "
44 data "[196]elete [210]ecord ","[196]isplay [198][201]le ","[208]rint [198]ile ","# [210]ecords "
45 data "[196]isk [198]unctions","[197]xit "
46 fori=1to7:readdf$(i):next
47 data "[214]iew [196]irectory ","[211]cratch [198]ile ","[210]ename [198]ile "
48 data "[197]rror [211]tatus ","[198]ormat [196]isk "
49 data "[214]alidate [196]isk ","[210]eturn to [208]rogram"
50 fori=1tonf:readfd$(i):next
60 fori=1tonc:readc$(i):next
80 sp$=" "
90 print"[147][154] [197]mployee [197]xpenses "
100 fori=1to10:printtab(13)""m$(i):next
101 gosub3600
105 r=4:m=1:poke214,r:print:printtab(13)"[153]"m$(m):r1=r:m1=m
110 getk$:ifk$=""then110
111 ifk$=chr$(13)then240
115 ifk$=""thenr=r+1:m=m+1:ifm=11thenm=1:r=4
120 ifk$="[145]"thenr=r-1:m=m-1:ifm=0thenm=10:r=13
125 poke214,r1:print:printtab(13)""m$(m1)
130 poke214,r:print:printtab(13)"[153]"m$(m)
135 r1=r:m1=m:goto110
240 onmgosub270,1400,440,530,640,790,960,1330,1590,4000
250 ifm=10then110
255 goto90
260 :
270 print"[147][154] [204]oad [198]ile "
280 print"[198]ilename: ";
290 l=15:ty=4:gosub3210:iff3thenreturn
300 fl$=v$:print
310 open15,8,15,"io"
320 open2,8,2,"0:"+fl$+",s,r"
330 input#15,e,e$,e1,e2
340 print"[150][196]isk [211]tatus:"e;e$;e1;e2
350 ifethenclose2:close15:print"[198]ile [206]ot [204]oaded":gosub2310:return
360 input#2,n
370 fori=1ton
380 forj=1tonf
390 input#2,a$(i,j)
400 next:next
410 close2:close15
420 return
430 :
440 n=n+1:x=n
450 print"[147][154] [193]dd [210]ecord "
460 gosub2470
470 iff3thenn=n-1:return
480 print"[154] [205]ore? [y/n]"
490 getk$:ifk$=""then490
500 ifk$="y"then440
510 return
520 :
530 print"[147][154] [195]hange [210]ecord "
540 gosub3420:ifflthenreturn
550 fl=0:f=3
560 print"[150][210]ecord # to change: ";
570 ty=2:l=3:gosub3210:x=val(v$)
580 iff3thenreturn
585 ifx>nthenreturn
590 gosub2240:iffl=1thenreturn
595 fori=1tonc:tp$(i)=a$(x,i):next
600 gosub3400:print"":gosub2470
610 iff3thenfori=1tonc:tp$(i)=a$(x,i):next
620 return
630 :
640 print"[147][154] [196]elete [210]ecord "
650 gosub3420:ifflthenreturn
660 fl=0:f=3
670 print"[150][210]ecord # to delete: ";
680 ty=2:l=3:gosub3210:x=val(v$)
690 iff3thenreturn
695 ifx>nthenreturn
700 gosub2240:iffl=1thenreturn
710 n=n-1
720 fori=xton
730 forj=1tonf
740 a$(i,j)=a$(i+1,j)
750 next:next
760 printtab(12)">[210]ecord deleted<"
770 gosub2310:return
780 :
790 print"[147][154] [196]isplay [198]ile "
800 gosub3420:ifflthenreturn
810 r=0:f=0:tl=0:gosub2620
820 iff3thenreturn
830 print"[147][154] [196]isplay [198]ile "
840 ifr=2andf$<>a$(s,1)then920
850 gosub3400:print""
860 print" [210]ecord #:"s
870 printfd$(1);a$(s,1);" ";c$(val(a$(s,1)))
880 fork=2tonf:printfd$(k);a$(s,k):next
890 tl=tl+val(a$(s,5)):v=tl:gosub2870
900 print"[150] [195]um [212]otal:[146] "xx$
910 gosub2380:iff3thenreturn
920 s=s+1:ifs<=ethen840
930 printtab(13)">[197]nd of file<"
940 gosub2310:return
950 :
960 print"[147][154] [208]rint [198]ile "
970 gosub3420:ifflthenreturn
980 r=0:f=0:tl=0:gosub2620
990 iff3thenreturn
1000 print"[153][208]rinter ready? [y/n]"
1010 getk$:ifk$=""then1010
1020 ifk$<>"y"thenreturn
1030 print"[154][208]rinting..."
1040 open2,4,7:cmd2
1050 printtab(5)"-------------------------------------------------------------";
1060 print"-----------"
1070 printtab(5)": [197]mployee [197]xpenses ";
1080 print" :"
1090 printtab(5)"-------------------------------------------------------------";
1100 print"-----------"
1110 printtab(5)": [195]ategory"spc(7)"[196]ate"spc(4)"[195]heck #"spc(2)"[196]escription";
1120 printspc(17);"[193]mount :"
1130 printtab(5)"------------------------------------------------------------";
1140 print"------------"
1150 fori=stoe
1160 ifr=2andf$<>a$(i,1)then1240
1170 cg=val(a$(i,1))
1180 printtab(5);": ";left$(c$(cg)+sp$,13);spc(2);
1190 printleft$(a$(i,2)+sp$,6);spc(2);
1200 printright$(sp$+a$(i,3),7);spc(2);
1210 printleft$(a$(i,4)+sp$,20);spc(1);
1220 printright$(sp$+"$"+a$(i,5),13);" :"
1230 tl=tl+val(a$(i,5))
1240 next
1250 v=tl:gosub2870
1260 printtab(5)"-------------------------------------------------------------";
1270 print"-----------"
1280 printspc(5)":";spc(28)"[212]otal: $"xx$;spc(34-len(xx$));":"
1290 printtab(5)"------------------------------------------------------------";
1300 print"------------"
1310 print#2:close2:return
1320 :
1330 print"[147][154] # [210]ecords "
1340 print" # [210]ecords:";n
1350 fm=peek(51)+256*peek(52)-peek(49)-peek(50)*256
1360 print"[198]ree [205]emory:";fm
1370 gosub2310
1380 return
1390 :
1400 print"[147][154] [211]ave [198]ile "
1410 gosub3420:ifflthenreturn
1420 print"[195]urrent [198]ilename: "fl$
1430 print" [198]ilename: ";
1440 l=15:ty=4:gosub3210:iff3thenreturn
1450 fl$=v$:print
1460 open15,8,15,"io"
1470 open2,8,2,"@0:"+fl$+",s,w"
1480 input#15,e,e$,e1,e2
1490 print"[150][196]isk [211]tatus:"e;e$;e1;e2
1500 ifethenclose2:close15:print"[198]ile [206]ot [211]aved.":gosub2310:return
1510 print#2,n
1520 fori=1ton
1530 forj=1tonf
1540 print#2,a$(i,j)
1550 next:next
1560 close2:iff1=0thenclose15
1570 return
1580 :
1590 print"[147][154] [196]isk [198]unctions "
1600 fori=1to7:printtab(12)""df$(i):next
1601 gosub3600
1605 r=4:m=1:poke214,r:print:printtab(12)"[150]"df$(m):r1=r:m1=m
1610 getk$:ifk$=""then1610
1620 ifk$=chr$(13)then1690
1625 ifk$=""thenr=r+1:m=m+1:ifm=8thenm=1:r=4
1630 ifk$="[145]"thenr=r-1:m=m-1:ifm=0thenm=7:r=10
1635 poke214,r1:print:printtab(12)""df$(m1)
1640 poke214,r:print:printtab(12)"[150]"df$(m)
1645 r1=r:m1=m:goto1610
1690 ifm=7thenreturn
1700 onmgosub1730,1780,1880,1960,2030,2150
1710 goto1590
1720 :
1730 print"[147] [214]iew [196]irectory "
1740 sys49152
1750 gosub2310
1760 return
1770 :
1780 print"[147] [211]cratch [198]ile "
1790 print"[198]ilename: ";
1800 ty=4:l=15:gosub3210
1810 ifv$=chr$(0)thenreturn
1820 print:print"[193]re you sure?"
1830 getk$:ifk$=""then1830
1840 ifk$<>"y"thenreturn
1850 open15,8,15,"s0:"+v$:close15
1860 return
1870 :
1880 print"[147] [210]ename [198]ile "
1890 print"[207]ld [198]ilename: ";:ty=4:l=15:gosub3210:f1$=v$
1900 ifv$=chr$(0)thenreturn
1910 print:print"[206]ew [198]ilename: ";:ty=4:l=15:gosub3210:f2$=v$
1920 ifv$=chr$(0)thenreturn
1930 open15,8,15,"r0:"+f2$+"="+f1$:close15
1940 return
1950 :
1960 print"[147] [196]isk [211]tatus "
1970 open15,8,15
1980 input#15,e,e$,e1,e2:close15
1990 print"[196]isk [211]tatus: "e;e$;e1;e2
2000 gosub2310
2010 return
2020 :
2030 print"[147] [198]ormat [196]isk "
2040 print"[150][201]nsert disk to be formatted."
2050 print"[196]isk name: ";:ty=4:l=15:gosub3210:dn$=v$
2060 ifv$=chr$(0)thenreturn
2070 print:print"[196]isk [201][196]: ";:ty=3:l=2:gosub3210:di$=v$
2080 ifv$=chr$(0)thenreturn
2090 print:print"[193]re you sure?"
2100 getk$:ifk$=""then2100
2110 ifk$<>"y"thenr